﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LibNiconico.NiconicoApi.Internal;
using LibNiconico.NiconicoApi.Extentions;

namespace LibNiconico.NiconicoApi.Videos.Comments.TheadKey
{
    /// <summary>
    /// ニコニコ動画スレッドキー取得レスポンス
    /// </summary>
    public sealed class NicoVideoGetThreadKeyResponse
    {
        private NicoVideoGetThreadKeyResponse(QueryStrings query)  { }
        
        /// <summary>
        /// スレッドキー
        /// </summary>
        public string ThreadKey { get; internal set; }

        internal static NicoVideoGetThreadKeyResponse Pearse(QueryStrings querys)
        {
            NicoVideoGetThreadKeyResponse res = new NicoVideoGetThreadKeyResponse(querys);
            res.ThreadKey = (from query in querys
                             where query.Key == "thread_key"
                             select query.Value).First() ?? "";
            return res;
        }
    }
}
